package com.aikon.wht.io;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.channels.FileChannel;

public class TestOfIo {

	public static void main(String[] args ) throws IOException{
		File file = new File("D:/io.txt");
		file.createNewFile();
		FileOutputStream fileOutputStream = new FileOutputStream(file);
		FileChannel fileChannel = fileOutputStream.getChannel();
		ByteBuffer buffer = ByteBuffer.allocate(1024);
		buffer.put("asdfasdf".getBytes());
		buffer.flip();
		fileChannel.write(buffer);
		fileOutputStream.close();
		fileChannel.close();
		
	}
}
